<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>

    </script>
</head>

<body>
    <div id="time">2020/12/6</div>
    <script>
        // 1、文档页面从上往下加载，所以先得有标签，js代码放在下面
        var timer = document.getElementById('time');
        console.log(timer);
        // 打印元素的属性和方法
        console.dir(timer);
    </script>
</body>

</html>